﻿using System.Collections.Generic;
using PT.Common;

namespace PT.Patterns {
    public class Rudiments {

        public static readonly Pattern SingleStrokeRoll;
        public static readonly Pattern SingleStrokeFour;
        public static readonly Pattern SingleStrokeSeven;

        public static readonly Pattern SingleParadiddle;



        static readonly List<Pattern> RudimentList;

        public static List<Pattern> List { get { return RudimentList; } }

        static Rudiments() {
            var qr = new Note { Name = "R", Duration = Rational.Quarter, Velocity = StrokeVelocity.Normal };
            var ql = new Note { Name = "L", Duration = Rational.Quarter, Velocity = StrokeVelocity.Normal };

            var er = new Note { Name = "R", Duration = Rational.Eight, Velocity = StrokeVelocity.Normal };
            var el = new Note { Name = "L", Duration = Rational.Eight, Velocity = StrokeVelocity.Normal };

            var sr = new Note { Name = "R", Duration = Rational.Sixteenth, Velocity = StrokeVelocity.Normal };
            var sl = new Note { Name = "L", Duration = Rational.Sixteenth, Velocity = StrokeVelocity.Normal };

            var srA = new Note { Name = "R", Duration = Rational.Sixteenth, Velocity = StrokeVelocity.Accent };
            var slA = new Note { Name = "L", Duration = Rational.Sixteenth, Velocity = StrokeVelocity.Accent };

            var erT = new Note { Name = "R", Duration = Rational.EightTriplet, Velocity = StrokeVelocity.Normal };
            var elT = new Note { Name = "L", Duration = Rational.EightTriplet, Velocity = StrokeVelocity.Normal };

            var srT = new Note {Name = "R", Duration = Rational.SixteenthTriplet, Velocity = StrokeVelocity.Normal};
            var slT = new Note {Name = "L", Duration = Rational.SixteenthTriplet, Velocity = StrokeVelocity.Normal};

            // Single stroke rudiments
            SingleStrokeRoll = new Pattern {sr, sl, sr, sl};
            SingleStrokeRoll.Name = "Single Stroke Roll";

            SingleStrokeFour = new Pattern {srT, slT, srT, el};
            SingleStrokeFour.Name = "Single Stroke Four";

            SingleStrokeSeven = new Pattern {srT, slT, srT, slT, srT, slT, qr, slT, srT, slT, srT, slT, srT, ql};
            SingleStrokeSeven.Name = "Single Stroke Seven";

            // Diddle rudiments
            SingleParadiddle = new Pattern {srA, sl, sr, sr, slA, sr, sl, sl};
            SingleParadiddle.Name = "Single paradiddle";

            RudimentList = new List<Pattern> { 
                new Pattern { Name = "<None>" },
                SingleStrokeRoll, SingleStrokeFour, SingleStrokeSeven,
                SingleParadiddle
            };
        }






    }
}
